import 'react-app-polyfill/ie11';
import 'react-app-polyfill/stable';
import React from 'react';
import GManager from "../module/GManager.js"
import global from "../module/Global.js"
import Header from "./Header.js";
// import Bottom from "./Bottom.js";
import "../css/main.css"
import $ from 'jquery'

class View extends React.Component {

    constructor(props) {
        super(props);
        this.state = {
            gManager: ""
        }
    }

    componentDidMount() {
        this.initViewStyle();
        let gManager = new GManager('__g');
        this.setState({
            gManager: gManager
        })
        // this.addBottomPanel(gManager.g);
    }

    initViewStyle() {
        let height = $(window).height() - 70;
        $("#__g").css("height", height);
    }

    addBottomBtn(g) {
        g.overlayLabel = g.objectManager.createOverlayLabel(g.__rootId);
        g.overlayLabel.imageName = "E:\\WebProject\\Gg3d_v2\\code\\static\\demo\\img\\bottom-ctrl.png";
        g.overlayLabel.setWidth(94, 0, 0);
        g.overlayLabel.setHeight(16, 0, 0);
        g.overlayLabel.setX(94, 0.5, 0);
        g.overlayLabel.setY(16, 0, 0);
        g.overlayLabel.visibleMask = 1;
    }

    initUIEvent(g) {
        g.callback["onUIWindowEvent"] = function (args, type) {
            if (args.uiWindow == null) {
                return;
            }
        };
    }

    render() {
        return (
            <div>
                <Header gManager={this.state.gManager}></Header>
                <object id="__g" type="application/x-cm-3d8" className='view-container'>error</object>
            </div>
        );
    }
}

export default View;



